Don't rename/free posnfilenametmp if we're not in tracking mode.
authorrobertl <robertl>
Thu, 19 Oct 2006 14:54:24 +0000 (14:54 +0000)
committerrobertl <robertl>
Thu, 19 Oct 2006 14:54:24 +0000 (14:54 +0000)
kml.c

diff --git a/kml.c b/kml.c
index 55ed3f56c0f83ac455c05be78c888a8fbfed7fcc..3d6f947651b2f95b67051c4f594d78840b248f81 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -276,8 +276,12 @@ static void
 kml_wr_deinit(void)
 {
        fclose(ofd);
-       rename(posnfilenametmp, posnfilename);
-       xfree(posnfilenametmp);
+
+       if (posnfilenametmp) {
+               rename(posnfilenametmp, posnfilename);
+               xfree(posnfilenametmp);
+               posnfilenametmp = NULL;
+       }
        ofd = NULL;
 }